namespace Study302 {



  interface ILiangzai {
    name: string
    love: string
  }

  interface Imeinv {
    name: string
    love: string
    play: string
  }

  type ILiangzaiArr = ILiangzai[]
  type StrArr = string[]


  function returnResF<T>(params: T[]): T[] {

    return params
  }

  // function returnResF<string>(params: string[]): string[]
  returnResF<string>(['str1', 'str1'])
  // function returnResF<ILiangzai>(params: ILiangzai[]): ILiangzai[]
  let liangzais = returnResF<ILiangzai>(
    [
      { name: '张健飞', love: '刘家锦' },
      { name: '刘国梁', love: '周波' }
    ]
  )

  console.log(liangzais);



  // 可以传多个泛型
  function returnResFMulti<I, O>(params: O & I): O & I {

    return params
  }

  // function returnResFMulti<ILiangzai, Imeinv>(params: Imeinv & ILiangzai): Imeinv & ILiangzai
  returnResFMulti<ILiangzai, Imeinv>({
    name: '刘长生',
    love: '郭嘉辉',
    play: '苏陈凤'
  })


  type fooType = { <T>(arg: T): T }
  let foo: { <T>(arg: T): T } = function <T>(params: T) {
    return params
  }
  // let foo: <"2333">(arg: "2333") => "2333"
  // let foo: <"mingzi">(arg: "mingzi") => "mingzi"
  foo('mingzi')




}

export {}